package com.wztk.shydemo.proxy;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import fivm.cross.platform.ficommon.distinguish.GsonSimpleSerializable;

import java.util.HashMap;

/**
 * Created by win7 on 2016/6/30.
 */
public class ProxyRequestArgs extends GsonSimpleSerializable {
    private String ports = "1998";                                      //端口号
    private String foreign = "none";                                    //是否提取大陆以外IP,全部(all) / 仅非大陆(only) / 仅大陆(none)
    private String exclude_ports = "8080";                              //排除端口号
    private String filter = "on";                                       //过滤24小时内提取过的
    private String protocol = "http";                                   //支持的协议
    private String category = "0";                                      //类别(匿名度)
    private String delay = "5";                                         //延迟，单位是秒
    private String sortby = "speed";                                    //默认最快优先， 传入 speed表示最快优先， time 表示最新优先
    private String format = "json";                                     //默认是文本，可以传入 xml json
    private String longlife = "20";                                     //转入数字，单位是分钟
    private String show_area = "true";                                  //返回IP所在地区
    private String show_operator = "true";                              //返回所属运营商

    //private String domain = "http://vip666.daili666api.com/ip/";
    //private String tid = "556226773217439";                             //订单号
    @Expose @SerializedName("domain")
    private String domain = "";
    @Expose @SerializedName("tid")
    private String tid = "";
    @Expose @SerializedName("num")
    private String num;                                         //提取数量		1到50000任意数字
    @Expose @SerializedName("area")
    private String area;                                       //地区，江苏 / 任意地区


    public ProxyRequestArgs() {
        //默认构造函数将一些默认的参数放在此处初始化
        ports = "1998";                         //端口号
        foreign = "none";                       //是否提取大陆以外IP,全部(all) / 仅非大陆(only) / 仅大陆(none)
        exclude_ports = "8080";                 //排除端口号
        filter = "on";                          //过滤24小时内提取过的
        protocol = "http";                      //支持的协议
        category = "0";                         //类别(匿名度)
        delay = "5";                            //延迟，单位是秒
        sortby = "speed";                       //默认最快优先， 传入 speed表示最快优先， time 表示最新优先
        format = "json";                        //默认是文本，可以传入 xml json
        longlife = "20";                        //转入数字，单位是分钟
        show_area = "true";                     //返回IP所在地区
        show_operator = "true";                 //返回所属运营商
    }

    protected HashMap getParamMap() {
        HashMap<String, String> paramMap = new HashMap<String, String>();
        paramMap.put("tid", tid);
        paramMap.put("num", num);
        paramMap.put("foreign", foreign);
        paramMap.put("delay", delay);
        paramMap.put("sortby", sortby);
        paramMap.put("format", format);
        paramMap.put("longlife", longlife);
        paramMap.put("show_area", show_area);
        paramMap.put("show_operator", show_operator);
        if ("" != this.area) {
            paramMap.put("area", area);
        }
        return paramMap;
    }


    public String getNum() {
        return num;
    }

    public String getDomain() {
        return domain;
    }

    public String getTid() {
        return tid;
    }

    public String getArea() {
        return area;
    }

    public String getPorts() {
        return ports;
    }

    public String getForeign() {
        return foreign;
    }

    public String getExclude_ports() {
        return exclude_ports;
    }

    public String getFilter() {
        return filter;
    }

    public String getProtocol() {
        return protocol;
    }

    public String getCategory() {
        return category;
    }

    public String getDelay() {
        return delay;
    }

    public String getSortby() {
        return sortby;
    }

    public String getFormat() {
        return format;
    }

    public String getLonglife() {
        return longlife;
    }

    public String getShow_area() {
        return show_area;
    }

    public String getShow_operator() {
        return show_operator;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public void setPorts(String ports) {
        this.ports = ports;
    }

    public void setForeign(String foreign) {
        this.foreign = foreign;
    }

    public void setExclude_ports(String exclude_ports) {
        this.exclude_ports = exclude_ports;
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public void setDelay(String delay) {
        this.delay = delay;
    }

    public void setSortby(String sortby) {
        this.sortby = sortby;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public void setLonglife(String longlife) {
        this.longlife = longlife;
    }

    public void setShow_area(String show_area) {
        this.show_area = show_area;
    }

    public void setShow_operator(String show_operator) {
        this.show_operator = show_operator;
    }
}
